package com.wyz.rabbitmqconsumer.service.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "email.topic.queue", durable = "true", autoDelete = "false"),
        exchange = @Exchange(value = "topic_order_exchange", type= ExchangeTypes.TOPIC),
        key = "com.email.#"
))
public class TopicEmailService {

    @RabbitHandler
    public void reviceSmsMessage(String msg){
        System.out.println("email.topic.queue接收消息：" + msg);
    }
}
